/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.f;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class k extends d {
    public k(Context paramContext, d.a parama) {
        super(paramContext, parama, true);
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "http://mgame.360.cn/bankpay/unbind_card.json";
    }

    protected boolean b() {
        return true;
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        if (TextUtils.isEmpty(str1)) {
            c.b("MMUnbindCreditCardTask", new Object[] { "UnbindCreditCard: qihooId is null!" });
            return null;
        }
        String str2 = a(1, paramArrayOfString);
        if (TextUtils.isEmpty(str2)) {
            c.b("MMUnbindCreditCardTask", new Object[] { "UnbindCreditCard: access token is null!" });
            return null;
        }
        String str3 = a(2, paramArrayOfString);
        if (TextUtils.isEmpty(str3)) {
            c.b("MMUnbindCreditCardTask", new Object[] { "UnbindCreditCard: pin bindId is null!" });
            return null;
        }
        String str4 = a(3, paramArrayOfString);
        if (TextUtils.isEmpty(str4)) {
            c.b("MMUnbindCreditCardTask", new Object[] { "UnbindCreditCard: pin subBankCode is null!" });
            return null;
        }
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("user_id", str1);
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("access_token", str2);
        String str5 = com.qihoo.gamecenter.sdk.pay.e.b.a(paramContext, str3, str4);
        c.a("MMUnbindCreditCardTask", new Object[] { "quickInfo=", str5 });
        if (!(TextUtils.isEmpty(str5)))
            localTreeMap.put("quick_info", str5);
        String str6 = s.a(localTreeMap, s.s(paramContext));
        c.a("MMUnbindCreditCardTask", new Object[] { "params=", str6 });
        if (b()) {
            this.a = s.b();
            String str7 = f.c(str6, this.a);
            String str8 = com.qihoo.gamecenter.sdk.common.f.b.a().a(this.a);
            localTreeMap = new TreeMap();
            localTreeMap.put("k", str8);
            localTreeMap.put("d", str7);
            c.a("MMUnbindCreditCardTask", new Object[] { a(), "?k=", str8, "&d=", str7 });
        }
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            int i = paramJSONObject.optInt("error_code", -1);
            String str1 = paramJSONObject.optString("error_msg", "");
            String str2 = paramJSONObject.optString("bind_id");
            if (i != -1) {
                a locala = new a();
                locala.a(i);
                locala.a(str1);
                locala.b(str2);
                return locala;
            }
        }
        return null;
    }

    public static class a {
        private int a;
        private String b;
        private String c;

        public boolean a() {
            return (this.a == 0);
        }

        public void a(int paramInt) {
            this.a = paramInt;
        }

        public void a(String paramString) {
            this.b = paramString;
        }

        public void b(String paramString) {
            this.c = paramString;
        }
    }
}